package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.entity.IesCust;

import java.util.List;

/**
 * ============================================================<br>
 * <p> ProjectName ：mybatis_plus </p>
 * <p> @author dongjianzhao </p>
 * <p> @date 2023/3/3 </p>
 * <p> @version ：1.0 </p>
 * ============================================================<br>
 * <p>
 *
 * </p>
 * ============================================================<br>
 */
@Mapper
public interface IesCustMapper extends BaseMapper<IesCust> {
    void batchInserts(List<IesCust> list);
    @Update("update\n" +
            "t_sys_dict t,\n" +
            "ies_cust i\n" +
            "set \n" +
            "i.status=t.`value`\n" +
            "where \n" +
            "t.name=i.status \n" +
            "and t.code='status';")
    void updatestatus();
    @Update("update\n" +
            "            ies_cust ic,\n" +
            "            t_sys_org t\n" +
            "            set ic.orgno=t.`code`\n" +
            "            where ic.orgname=t.`name`")
    void updateorgcode();
    @Update("UPDATE `ies_cust` i,`dgj_down` d SET i.type_code_name=d.type_code_name WHERE  d.type='down1' AND i.custids=d.cust_id;")
    void updateTypeCodeName();
    @Select("select * from ies_cust_djz20230316 where custids=#{custid}")
    IesCust selectCustId(@Param("custid") String custid);
}
